package com.kristin.dubbo.client;


import com.kristin.dubbo.service.GreetingService;
import com.kristin.dubbo.service.GreetingServiceImpl;
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.ServiceConfig;

import java.util.concurrent.CountDownLatch;

/**
 * @ClassName ClientA
 * @Description TODO
 * @Author Kristin
 * @Date 2021/06/21 16:21:04
 * @Version 1.0.0
 */
public class ClientA {

    public static void main(String[] args) throws InterruptedException {
        ServiceConfig<GreetingService> service = new ServiceConfig<GreetingService>();
        service.setApplication(new ApplicationConfig("first-dubbo-provider"));
        service.setRegistry(new RegistryConfig("zookeeper://" + "127.0.0.1" + ":2181"));
        service.setInterface(GreetingService.class);
        service.setRef(new GreetingServiceImpl());
        service.export();
        System.out.println("dubbo service started");
        new CountDownLatch(1).await();
    }

}

